package com.activemq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.jms.annotation.EnableJms;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author yexi
 */
@SpringBootApplication
@Slf4j
@EnableJms
public class ActiveMqApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext run = SpringApplication.run(ActiveMqApplication.class, args);
        Integer port = run.getBean(ServerProperties.class).getPort();
        log.info("服务已启动，测试接口地址: http://{}:{}/send", InetAddress.getLocalHost().getHostAddress(), port);
    }

}
